package com.feign;

import com.request.baidu.*;
import com.response.baidu.*;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;


@FeignClient(url = "http://192.168.10.88:8080", name = "baiduApiFeign")
public interface BaiduApiFeign {


    @RequestMapping(value = "/deviceManage/getDeviceID", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    GetDeviceVO getDeviceID(@RequestBody GetDeviceIdForm getDeviceIdForm);



    @RequestMapping(value = "/deviceManage/restart", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    RestartVO restart(@RequestBody GetDeviceIdForm getDeviceIdForm);



    @RequestMapping(value = "/deviceManage/reset", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    RestartVO reset(@RequestBody GetDeviceIdForm getDeviceIdForm);



    @RequestMapping(value = "/deviceManage/setWiredNetwork", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    SetWiredNetworkVO setWiredNetwork(@RequestBody SetWiredNetworkForm setWiredNetworkForm);

    @RequestMapping(value = "/deviceManage/setBootupRegMethod", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    SetBootupRegMethodVO setBootupRegMethod(@RequestBody SetBootupRegMethodForm setBootupRegMethodForm);


    /**
     * {
     * 	"code":	true,
     * 	"log":	"success!"
     * }
     * {
     * 	"code":	false,
     * 	"log":	"failed!"
     * }
     * @param setDeviceHeartBeatForm
     * @return
     */
    @RequestMapping(value = "/deviceManage/setDeviceHeartBeat", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    SetHeartBeatVO setDeviceHeartBeat(@RequestBody SetDeviceHeartBeatForm setDeviceHeartBeatForm);


    /**
     * callback 请求
     * {
     * 	"device_id":	"BD12345678901234",
     * 	"timestamp" : 1577690264,  //(UNIX时间戳:秒)
     * 	"user_id": "user_id"
     * }
     *
     * callback返回
     * {
     * 	"code":	true,
     * 	"log":	"success!"
     * }
     * @param setDeviceHeartBeatForm
     * @return
     */
    @RequestMapping(value = "/deviceManage/setUserCallback", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    RestartVO setUserCallback(@RequestBody SetDeviceHeartBeatForm setDeviceHeartBeatForm);

    /**
     * 软件版本默认为三位号，1.0.0，第一位表示架构更新，第二位表示功能或模型变更，第三位表示bug修复或小功能修改
     * @param getDeviceIdForm
     * @return
     */
    @RequestMapping(value = "/deviceManage/getSoftVersion", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    VersionVO getSoftVersion(@RequestBody GetDeviceIdForm getDeviceIdForm);


    /**
     * 用户注册或更新
     * {
     * 	"pass": "pass",
     * 	"user_id": "user_id",
     * 	"image_content":"image.base64/image.url/feature.base64",
     * 	"image_type": "image/URL/feature",
     * 	"user_info": {
     * 		"name":"name",
     * 		"phone_number":"12345"
     *        },
     * 	"action_type": "APPEND/REPLACE",
     * 	"quality_control": "NONE/LOW/NORMAL/HIGH",
     * 	"auth_start_time": 1577690264,
     * 	"auth_end_time": 1577690264
     * }
     *
     * 返回：
     * {
     * 	"user_id": "user_id",
     * 	"position": {
     * 		"point_1":"(10,10)",
     * 		"point_2":"(80,80)"
     *        },
     * 	"create_time": 1577690264,
     * 	"device_id": "device_id",
     * 	"code":	true,
     * 	"log":	"'addUser' success!"
     * }
     * @param addUserForm
     * @return
     */
    @RequestMapping(value = "/userManage/addUser", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    AddUserVO addUser(@RequestBody AddUserForm addUserForm);

    @RequestMapping(value = "/userManage/deleteUser", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    DelUserVO deleteUser(@RequestBody DelUserForm delUserForm);


    @RequestMapping(value = "/userManage/getUserInfo", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    GetUserInfoVO getUserInfo(@RequestBody DelUserForm delUserForm);

    @RequestMapping(value = "/userManage/getUserList", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    GetUserListVO getUserList(@RequestBody GetUserListForm getUserListForm);


    @RequestMapping(value = "/userManage/deleteUserImages", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    DelUserVO deleteUserImages(@RequestBody DelUserForm delUserForm);


    @RequestMapping(value = "/recognitionManage/getFeature", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    GetFeatureVO getFeature(@RequestBody GetFeatureForm getFeatureForm);


    @RequestMapping(value = "/recognitionManage/match", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    MatchVO match(@RequestBody MatchForm matchForm);

    @RequestMapping(value = "/recognitionManage/identify", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    IdentifyVO identify(@RequestBody IdentifyForm identifyForm);


    @RequestMapping(value = "/recognitionManage/setQualityControl", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    SetQualityControlVO setQualityControl(@RequestBody SetQualityControlForm setQualityControlForm);


    @RequestMapping(value = "/recognitionManage/setMinSize", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    SetQualityControlVO setMinSize(@RequestBody SetMinSizeForm setMinSizeForm);


}
